bitkeeper revision 1.1159.1.67 (41207f1cCT7YHIMzP5SKhkRLzpuobA)
authormjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>
Mon, 16 Aug 2004 09:32:12 +0000 (09:32 +0000)
committermjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>
Mon, 16 Aug 2004 09:32:12 +0000 (09:32 +0000)
Don't compress domain save files.
Don't use O_EXCL.

tools/libxutil/Makefile
tools/xfrd/xfrd.c

index 8be24daa92106d978a10f4b8c90fa538c09b2cb3..e3d15e85cbe9a1e095e531a15731a4a786630b16 100644 (file)
@@ -27,16 +27,14 @@ MAJOR    := 1.3
 MINOR    := 0
 LIB_NAME := libxutil
 LIB      := $(LIB_NAME).so 
-LIB      += $(LIB_NAME).so.$(MAJOR)
-LIB      += $(LIB_NAME).so.$(MAJOR).$(MINOR)
 
 all: check-for-zlib $(LIB)
 
-$(LIB_NAME).so:
-       ln -sf $(LIB_NAME).so.$(MAJOR) $@
+$(LIB_NAME).so: $(LIB_NAME).so.$(MAJOR)
+       ln -sf $^ $@
 
-$(LIB_NAME).so.$(MAJOR):
-       ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $@
+$(LIB_NAME).so.$(MAJOR): $(LIB_NAME).so.$(MAJOR).$(MINOR)
+       ln -sf $^ $@
 
 $(LIB_NAME).so.$(MAJOR).$(MINOR): $(LIB_OBJS)
        $(CC) -Wl,-soname -Wl,$(LIB_NAME).so.$(MAJOR) -shared -o $@ $^
@@ -54,7 +52,7 @@ install: all
        install -m0755 $(LIB) $(prefix)/usr/lib
 
 clean:
-       $(RM) *.a *.so *.o *.rpm $(LIB)
+       $(RM) *.a *.so *.so.* *.o *.rpm 
        $(RM) *~
        $(RM) $(DEPS)
 
index c5abcdcf1b6ee852bdf185391919a97a82a2c64f..5f3b4752bf110aa42f6a492d2dbe2933541e5e6e 100644 (file)
@@ -738,22 +738,18 @@ int xfr_send(Args *args, XfrState *state, Conn *xend, uint32_t addr, uint32_t po
  */
 int xfr_save(Args *args, XfrState *state, Conn *xend, char *file){
     int err = 0;
-    int flags = (O_CREAT | O_EXCL | O_WRONLY);
-    int mode = 0644;
-    int fd;
+    int compress = 0;
     IOStream *io = NULL;
 
     dprintf("> file=%s\n", file);
-    fd = open(file, flags, mode);
-    if(fd < 0) {
-        eprintf("> Failed to open %s\n", file);
-        err = -EIO;
-        goto exit;
+    if(compress){
+        io = gzip_stream_fopen(file, "wb1");
+    } else {
+        io = file_stream_fopen(file, "wb");
     }
-    io = gzip_stream_fdopen(fd, "wb1");
     if(!io){
-        eprintf("> Failed to allocate gzip state for %s\n", file);
-        err = -ENOMEM;
+        eprintf("> Failed to open %s\n", file);
+        err = -EINVAL;
         goto exit;
     }
     err = xen_domain_snd(xend, io, state->vmid, state->vmconfig, state->vmconfig_n);